#pragma once
#ifndef SYPX_RENDERER
#define SYPX_RENDERER

#include "Base.h"
#include "Types.h"

namespace SypX
{
	///Renderer is an abstract base class defining a common interface all SypX renderers must implement.
	///A Renderer in SypX is a low level wrapper over 3D APIs like OpenGL/OpenGLES/DirectX and not a high 
	///level engine which does scene level optimisation/batching/sorting.
	class SYPXAPI Renderer
	{
	public:
		Renderer();
		virtual ~Renderer();
		///Inits the Renderer. Usually does things like initialising Rendering API, setting viewport
		virtual void init(UInt width, UInt height);
		///Clears the screen
		virtual void clearScreen(bool color=true, bool depth=true) = 0;
		///Sets the clear screen color
		virtual void setClearScreenColor(const Vec4& color);
		///Sets the active Color to be used for rendering 
		virtual void setActiveColor(const Vec4& color);
		///Draws a mesh given an instance
		virtual void drawMesh(MeshInstance* mi)=0;		
		///Creates and allocates the texture on GPU. (Usually called by Texture class itself and not directly)
		virtual void createTexture(Texture* tex)=0;
		///Deletes the texture from the GPU
		virtual void deleteTexture(Texture* tex) = 0;		
	protected:
		UInt width;
		UInt height;
		Vec4 clearColor;
		Vec4 activeColor;
	
	};
}

#endif
